Optimizing Dynamic Class Composition in a Statically Typed Language

نویسندگان

  • Anders Bach Nielsen
  • Erik Ernst
چکیده

In statically typed languages the set of classes and similar classifiers is commonly fully determined at compile time. Complete classifier representations can then be loaded at run-time, e.g., from a an executable file or a class file. However, some typing constructs—such as virtual classes—enable a type safe treatment of classifiers and their associated types and instances, even in the case where classifiers are created dynamically. This opens the opportunity to make dynamic class computations available as an integrated part of the language semantics. The language gbeta is an example where this is achieved based on mixins and linearization. In this paper we focus on the virtual machine related challenges of supporting dynamic class composition. In particular we present some core algorithms used for creating new classes, as well as some performance enhancements in these algorithms.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Superimposed Delegation

Object composition a well-known programming technique for supporting dynamic adaptation in statically typed class-based object-oriented programming languages suffers from two non-trivial problems; the common-self problem and the object reference update problem. Recently, it has been shown that the common-self problem can be solved for object composition in statically typed class-based languages...

متن کامل

Type Inference to Optimize a Hybrid Statically and Dynamically Typed Language

Dynamically typed languages are becoming increasingly popular for different software development scenarios such as Web engineering, rapid prototyping, or the construction of applications that require runtime adaptiveness. In contrast, statically typed languages have undeniable advantages such as early type error detection and more opportunities for compiler optimizations. Since both approaches ...

متن کامل

Safe Cross-Language Inheritance

Inheritance is a standard means for reuse and for interfacing with external libraries. In a multi-language software product, extending a class written in a statically-typed language with a dynamicallytyped class can require a significant number of manual indirections and other error-prone complications. Building on our previous interoperability work, we introduce a technique that allows safe, e...

متن کامل

Dynamic extension of typed functional languages

We present a solution to the problem of dynamic extension in statically typed functional languages with type erasure. The presented solution retains the benefits of static checking, including type safety, aggressive optimizations, and native code compilation of components, while allowing extensibility of programs at runtime. Our approach is based on a framework for dynamic extension in a static...

متن کامل

A Theory of Tagged Objects

Foundational models of object-oriented constructs typically model objects as records with a structural type. However, many object-oriented languages are class-based; statically-typed formal models of these languages tend to sacrifice the foundational nature of the record-based models, and in addition cannot express dynamic class loading or creation. In this paper, we explore how to model static...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2008